home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #112 (199x)(Scope PD)(US)[WB].zip / Scope Disk #112 (199x)(Scope PD)(US)[WB].adf / Conman / ConMan.doc < prev    next >
Text File  |  1990-01-24  |  25KB  |  454 lines

  1.                                ConMan V1.3c
  2.                Copyright © 1987,1988,1989 by William S. Hawes
  3.    
  4.    ConMan is a replacement console handler that provides line editing and
  5.    command history for any software that uses CON: windows.  It runs under
  6.    AmigaDOS V1.2 and later, and is completely transparent to other software.
  7.    After ConMan has been activated, all CON: windows opened by AmigaDOS will 
  8.    automatically use the ConMan handler.  This includes the console windows
  9.    opened by NEWCLI as well as any data input/output windows that your other
  10.    software may use.
  11.    
  12.    Features new to ConMan V1.3c include the CNN: handler for invisible,
  13.    non-blocking type-ahead, the CNX: (extensible) handler for use of the
  14.    serial device as a console, improved editing of long lines, and support
  15.    for superbitmap windows.  ConMan also now supports deferred opening, in
  16.    which the console window is not actually opened until a read or write
  17.    request is received.
  18.    
  19.    As was the case with prior releases, ConMan is distributed as shareware
  20.    (user-supported software), and I'm pleased to report that the rate of
  21.    contributions has increased since the last release.  Shareware is a
  22.    welcome alternative to the high costs of commercial software, and I hope
  23.    that you'll do your part to support ConMan and other shareware products.
  24.    
  25.    
  26.                           ----- Line Editing -----
  27.    ConMan allows you to edit the active (command) line using the left- and
  28.    right-arrow keys for cursor positioning.  The shifted left-arrow key 
  29.    skips to the beginning of the current or previous word, and the shifted 
  30.    right-arrow key skips to the start of the next word.
  31.    
  32.    ConMan supports both insert and overstrike editing modes.  The CTRL-A
  33.    key toggles between the two modes, and the CTRL-^ key unconditionally
  34.    selects insert mode.  The default input mode is insert, but you can set
  35.    the global -o flag to select overstrike mode.  The input mode normally
  36.    reverts to the default mode each time you press RETURN, but the global
  37.    -s ("sticky") flag will cause the mode to remain set until you change it
  38.    explicitly.
  39.    
  40.    You can select insert or overstrike mode when you first install ConMan,
  41.    and can change it at any time using the SetCMan command utility.  Try 
  42.    experimenting to see which input mode you like best, but note that the
  43.    input modes are global and therefore apply to ALL ConMan windows.  Refer
  44.    to the paragraph on installation for a list of the global option flags.
  45.    
  46.    There are several keys that can be used to delete characters, words, or 
  47.    the entire line.  The DEL key deletes the character under the cursor, 
  48.    and the BACKSPACE key deletes the character to the left of the cursor.  
  49.    CTRL-Y deletes from the cursor position to the end of the line, and 
  50.    CTRL-U deletes from the cursor to the start of the line.  CTRL-X deletes
  51.    the entire line, in keeping with the default CON: device.
  52.     
  53.    Function keys F7 and F8 can be used to delete words in the backwards and 
  54.    forwards direction, respectively.  They work just like the shifted left- 
  55.    and right-arrow keys except that the characters are deleted.
  56.    
  57.    CTRL-Z deletes both the current line and any lines that have been typed
  58.    ahead (but not yet read); this is very handy if you want to completely 
  59.    abandon all typed-ahead lines.  CTRL-R provides a less drastic recall 
  60.    by posting the typed-ahead lines back to the command line.  CTRL-W clears
  61.    the entire window and then redisplays the active line.
  62.    
  63.    The Undo Buffer.
  64.    Suppose that you're editing a line and you accidentally hit the up- or
  65.    down-arrow key.  You've just lost the line, right?  Not at all --- just
  66.    press the CTRL-- (control-minus) key and the former line will be posted
  67.    back to the command line, with the cursor right where you left it!
  68.    
  69.    There is no limit to the number of lines that can be undone, but only
  70.    lines that have been changed are added to the undo buffer.  All "undo"
  71.    lines are discarded when you finally enter RETURN.
  72.    
  73.    Flow Control.
  74.    CTRL-S and CTRL-Q have been implemented to hold and release the screen
  75.    output, respectively.  After pressing the CTRL-S key, all output to the
  76.    window will be held until you release it with a CTRL-Q.  ConMan will
  77.    "beep" the display if you try to type with CTRL-S in effect, in order
  78.    to provide some visual indication that output is held.
  79.    
  80.    End-of-File.
  81.    ConMan recognizes the CTRL-\ character as an end-of-file and sends a
  82.    zero-length block to the task reading from the handler.  CTRL-\ can be
  83.    used to terminate a copy operation.
  84.    
  85.    All characters not explicitly required for editing purposes are passed
  86.    on to the command line.  In order to provide a consistent display, 
  87.    characters that might cause interference with the display (like CTRL-L)
  88.    are rendered as a caret (^) followed by the uppercase alphabetic
  89.    character.  The CTRL-N (shift-in) and CTRL-O (shift-out) characters are
  90.    supported by ConMan; these are non-printable by themselves, but serve
  91.    to select and unselect the alternate character set.  Miscellaneous
  92.    non-printable characters are displayed as a hash mark.
  93.    
  94.    ConMan now allows control sequences can be entered incrementally.  For
  95.    example, entering ESC, [, 0, and ~ will simulate the effect of an F1 key.
  96.    
  97.    
  98.                           ----- Command History -----
  99.    ConMan "remembers" the commands that you type and lets you recall them
  100.    sequentially using the up- and down-arrow keys.  If you go past the line
  101.    you want, the down-arrow key will retrieve the next (more recent) line.  
  102.    The shifted up-arrow key recalls the oldest line, and shifted down-arrow 
  103.    recalls the most recent line.  The CTRL-B key clears the history buffer.
  104.    
  105.    The history buffer is organized as a fixed-length memory pool with a
  106.    default length of 488 bytes.  New lines are inserted at one end, and 
  107.    the oldest lines are pushed off the other end to make room.  The number
  108.    of lines that can be saved depends on their lengths, but is generally in
  109.    the range of 25 to 30.  The default size can be changed when you install 
  110.    ConMan by using the -b option followed by the desired size in bytes.  
  111.    For example, the command "conman -c -b1000" would install ConMan with a 
  112.    1000-byte history buffer.
  113.    
  114.    ConMan maintains the history in one of two modes.  In the default mode, 
  115.    recalled lines are not reentered into the history buffer unless the line
  116.    was "touched," and the history index pointer is left positioned at the
  117.    retrieved line.  This mode is convenient if you often go back into the
  118.    buffer to retrieve sequences of commands.
  119.    
  120.    In "true history" mode, every line is reentered into the history buffer,
  121.    even if it wasn't modified after being recalled.  The history pointer is
  122.    always reset (to the most recent line) whenever a line is added to the
  123.    buffer.
  124.    
  125.    The history mode can be selected when ConMan is installed or by using the
  126.    "SetCMan CON: -t" command.  Note that ConMan checks for duplicate entries
  127.    irrespective of whether standard or "true" history is selected.  If the
  128.    current line matches the previous line entered, the line is not reentered.
  129.    
  130.    Minimum Line Length.
  131.    You can define a minimum line length to be saved in the history buffer by
  132.    using the -LNNN option.  The number following the -L is the limit at or
  133.    below which lines will not be saved; the default value is 0.  For example,
  134.    "conman -c -L2" will ignore lines of 2 or fewer characters.
  135.    
  136.    Wrap-Around History.
  137.    If you prefer to maintain the command history as a circular buffer rather 
  138.    than as a stack, try setting the -wrap option with ConMan or SetCMan.  
  139.    The index will "wrap-around" when it hits the top or bottom of the stack.
  140.    
  141.    Versions 1.1 and later of ConMan include a command called "History" to
  142.    save, load, or display the history buffer.  Refer to the "Extras.doc" 
  143.    file for more information.
  144.    
  145.    
  146.                           ----- Function Keys -----
  147.    ConMan has several additional editing functions and window control options
  148.    that use the function keys.
  149.    
  150.    Key F1 shrinks ("iconifies") the window to its minimum size, and key F2 
  151.    "zooms" the window to its maximum size (usually the entire screen.)  Both
  152.    keys act as toggles, and shrunken windows may be zoomed (and vice-versa.)
  153.    ConMan V1.3 provides a minor enhancement to the zoom feature:  if the 
  154.    window is not exactly at the top of the screen when F2 is hit, it will be
  155.    positioned one pixel down from the top, rather than right at the top.  
  156.    This allows you to slide the screen even if the window covers most of it.
  157.    If the window was opened without a sizing gadget, neither F1 or F2 will 
  158.    have any effect.
  159.    
  160.    Keys F5 and F6 are used to search for commands.  If you type a partial 
  161.    command line and then press F6, ConMan searches in the up-arrow direction 
  162.    for a line matching up to the cursor position.  You can move the cursor
  163.    to the right to constrain the search.  Key F5 works similarly in the 
  164.    down-arrow direction.
  165.    
  166.    Keys F7 and F8 delete words in the backwards and forwards direction.  
  167.    They operate just like the shifted left- and right-arrow keys, except
  168.    that the words are deleted rather than just skipped over.
  169.    
  170.    Function key F9 moves the screen to the front or back of the display, 
  171.    and F10 moves the window to the front or back.  Both keys act as toggles 
  172.    provided that you don't deactivate the window or screen.  These keys are
  173.    useful when you're working with multiple windows or screens and need to 
  174.    peek at the one in back.
  175.    
  176.    
  177.                         ----- Window Definitions -----
  178.    ConMan accepts the standard AmigaDOS window specifications.  For example,
  179.    "CON:160/50/320/100/MyWindow" specifies a window 320x100 pixels in size,
  180.    beginning in position (160,50).  The numeric parameters are truncated
  181.    against the maximum screen size, so a larger-than-normal window may be
  182.    safely specified (for those of you using "morerows").  The default size
  183.    is the full screen width and height.  ConMan sets the minimum window size
  184.    to allow room for the close gadget and depth gadgets.
  185.    
  186.    Various Intuition options and gadgets can be selected by including a list
  187.    of attributes after the window title.  Here's how it works:  put another 
  188.    slash ("/") after the window title, and follow it with any of the
  189.    attribute options listed below.
  190.    
  191.       Option Character                 Default Value   
  192.       ----------------                 -------------
  193.       A <==> Activate                  Activated
  194.       B <==> BackDrop                  Not a backdrop
  195.       C <==> Close gadget              No close gadget
  196.       D <==> Depth gadgets             Depth gadgets
  197.       M <==> Move (drag) gadget        Drag gadget
  198.       N <==> NoBorder                  Border (sorry, "B" was used)
  199.       R <==> Refresh (SMART/SIMPLE)    Smart refresh
  200.       S <==> Sizing gadget             Sizing gadget
  201.       Z <==> Zero-Zero                 Not a GZZ
  202.    
  203.    Each option character will TOGGLE the corresponding window attribute,
  204.    so if you include an option twice, it will cancel the effect.  Any 
  205.    unrecognized attribute characters are ignored, and the closing slash is 
  206.    optional.  My apologies to those who wanted a slash in the title.
  207.    
  208.    Examples: CON:10/10/300/100/Behind/nb/   a borderless backdrop window.
  209.              CON:10/10/300/100/Fixed/acm    a nonactivated window, with a 
  210.                                             close gadget, that won't budge.
  211.    
  212.    You can select the colors for the window's titlebar area by appending a
  213.    '/' to the attribute list and specifying the "detail pen" and "block pen"
  214.    color values; the color numbers are listed below.
  215.  
  216.       Pen Number  Color
  217.       ----------  -----
  218.           0       Blue
  219.           1       White
  220.           2       Black
  221.           3       Red
  222.  
  223.    For example, "CON://640/100/Colors!/ac/23" would specify a window with
  224.    black letters (the detail pen) on a red titlebar (the block pen).
  225.  
  226.  
  227.                           ----- Installation ----
  228.    To install ConMan you'll need to copy a few files to your system disk,
  229.    but don't worry --- they're all small.  Install the file "Conhandler"
  230.    in your L: directory, to keep those bigger handlers company.  Then copy
  231.    the file "conhandler.library" into your LIBS: directory.  Now copy the 
  232.    commands "ConMan", "SetCMan", and "History" to your C: directory; the 
  233.    other command programs are optional.  The included "ExecuteMe" file will
  234.    handle the installation if you'd rather do it automatically.
  235.    
  236.    If you received ConMan in the form of an ARCed file, first deARC it and
  237.    then rename "conlib.lib" to "conhandler.library", or use the provided
  238.    "ARCInstall" script to copy the files.
  239.    
  240.    Once these files have been installed, issue the command "conman -c" to 
  241.    activate the handler.  After you've activated ConMan, open a CLI window
  242.    using NEWCLI and check to make sure that the new window has line editing
  243.    and command history.  Once everything is working properly, you should
  244.    place the "conman -c" command in your startup-sequence so that it's always
  245.    available.
  246.    
  247.    NOTE:  ConMan affects only those windows opened AFTER you activate it!
  248.    It would be very impolite indeed to pull the old handler out from under 
  249.    the existing console windows.
  250.    
  251.    You can specify several command line arguments with the ConMan command:
  252.    
  253.       Code     Action
  254.       ------   ------
  255.       -bNNNN   select buffer size NNNN bytes
  256.       -c       install as CON: (the default)
  257.       -lNNN    minimum length to save
  258.       -o       select overstrike mode
  259.       -r       install as RAW:
  260.       -s       select "sticky" mode
  261.       -t       maintain "true history"
  262.       -w       select "wrap-around" history
  263.    
  264.    These command options can appear in any order and remain in effect until
  265.    you reboot the computer.  The options established by the ConMan command
  266.    are the global defaults inherited when each device is opened.  Subsequent
  267.    changes must be made using the SetCMan command described below.
  268.    
  269.    A separate utility program called "SetCMan" has been provided to modify 
  270.    the global options or device attributes.  You can use SetCMan to change
  271.    the -o, -s, -t, or -w options at any time, and the device attributes -d
  272.    (deferred opening) and -n (non-blocking) can be set if no devices of the
  273.    specified type are open.  To set the options on a device-by-device basis,
  274.    a device name must supplied with the command, as the examples illustate.
  275.    Examples: setcman ?            ; displays the template
  276.              setcman -o -s -t     ; overstrike, sticky, true history
  277.              setcman CON: -n      ; set CON: for non-blocking
  278.              setcman CNC: -d -w   ; CNC: deferred opening with wrap history
  279.    
  280.    If you usually operate from Workbench and only occasionally need a CLI,
  281.    you can activate ConMan by using the icons.  First double-click on the 
  282.    "LoadLib" icon to load the conhandler library, and then activate ConMan
  283.    by double-clicking the "ConMan" icon.  The next CLI you open should now
  284.    have the line editing and command history provided by ConMan.
  285.    
  286.    
  287.                           ----- Distribution -----
  288.    This program is distributed as shareware (user-supported software) to 
  289.    Amigoid life-forms everywhere!  Make sure your friends get a copy.  
  290.    Your contributions are greatly appreciated and will help me maintain 
  291.    ConMan as well as develop new products.  Send all correspondence to:
  292.    
  293.          By Mail:                      By Telephone or EMail:
  294.          -----------------             ------------------------------
  295.          William S. Hawes              Phone: (508) 568-8695
  296.          P.O. Box 308                  BIX: whawes
  297.          Maynard, MA 01754             CIS: 72230,267
  298.          USA                           PLINK: whawes
  299.  
  300.    The suggested contribution is $10 (based on an earlier survey), but any 
  301.    amount is welcome.  The number of registered ConMan users has increased
  302.    significantly since the last release, but is still far below what would
  303.    be expected for a comparable commercial product.
  304.    
  305.    Commercial vendors are welcome to include ConMan with their products,
  306.    provided that it's noted as being shareware and that the documentation 
  307.    accompanies the software.
  308.    
  309.    
  310.                           ----- Other Products -----
  311.    I have a couple of other products available commercially.   ARexx and 
  312.    WShell can be found at better dealers**, or you can order them directly 
  313.    from me at the above address.
  314.    
  315.    ARexx is a multitasking implementation of the REXX language, a high-level
  316.    interpreted language designed for macro-processing.  ARexx has become the
  317.    de facto standard for inter-program communications and can be used as the
  318.    macro language for any software package that includes an ARexx interface.
  319.    It's both powerful and easy-to-learn, and is well documented in a 150-page
  320.    manual.  ................................. Only $49.95 (plus $2 shipping)
  321.    
  322.    WShell is a much-enhanced but highly compatible CLI replacement that
  323.    offers aliases, built-in and resident commands, concurrent command piping
  324.    (as in pgm1 | pgm2 | ... | pgmN), extended prompt/window titlebar fields,
  325.    transparent support for REXX macro programs, an "implicit" CD command,
  326.    script-bit support, and lots of other features.  Isn't it time you put
  327.    some mussel into your command environment?  Just 50 clams (+ $2 shipping)
  328.    
  329.    ** better dealers are those that stock ARexx and WShell.
  330.    
  331.    
  332.                           ----- Further Notes -----
  333.    ConMan also accepts window specifications in the form "CON:w20480", where
  334.    the hex digits following the "w" are the absolute address of an Intuition
  335.    window pointer.  This allows you to attach a console handler to a window
  336.    in a multitasking-safe way (unlike the methods that require setting a
  337.    field in the DOS device list).  If you're writing in C, you could use
  338.    the following sequence to open a window and attach a DOS console to it:
  339.    
  340.          window = OpenWindow(&newwindow);   /* get a window          */
  341.          sprintf(buffer,"CON:W%x",window);  /* build the name string */
  342.          file  = Open(buffer,MODE_OLDFILE); /* open a console stream */ 
  343.    
  344.    You can open a console window on a custom screen by passing the hex
  345.    address of the screen preceded by an "S" in the specification string,
  346.    as in "CON:S123abc/10/10/300/100/MyWindow."  ConMan will accept "S*" as
  347.    a shorthand notation for the frontmost screen, so a specification like
  348.    "CON:S*/0/0/300/100/Front" would open on whichever screen was in front.
  349.    Watch out for using S* in a double quoted-string, though, since the * is
  350.    the default AMigaDOS escape character.  If your console specification 
  351.    includes spaces and thus needs to be quoted, you'll need to use S** as
  352.    in this example:
  353.      1> newcli "CON:S**/0/0/640/100/My Window/a/23"
  354.  
  355.    In addition, ConMan now supports superbitmap windows as well.  The bitmap
  356.    structure is passed as a "B" followed by the hex address, as for example
  357.    "CON:B123ABC/0/0/300/100/Super!".  The console device currently has some
  358.    bugs related to using superbitmaps (for example, the cursor disappears),
  359.    but this feature may be handy anyway.
  360.    
  361.    
  362.    Other Names.
  363.    ConMan is actually several DOS handlers rolled into one, and it selects
  364.    the desired mode of operation by looking at the name used to open it.  
  365.    The four special names recognized are CND:, CNN:, CNX:, and PIP:, and all
  366.    other names are considered equivalent to CON:.
  367.    
  368.    In order to use ConMan under any name other than CON:, you'll need to add
  369.    one or more of the supplied mountlist entries to your DEVS:mountlist file
  370.    and then issue the "mount" command.  For example, to define ConMan as the
  371.    CNC: device, add the CNC: entry to DEVS:mountlist and issue "mount CNC:".
  372.    Once you've done this, you can get a ConMan window by specifying a name
  373.    like CNC://640/100/MyWindow.  This allows the CON: definition to be left
  374.    intact, in case there are any incompatibilities between ConMan and your
  375.    existing software (but please let me know of any problems!)
  376.  
  377.    Warning: DO NOT USE the ARP mount command to mount ConMan --- it has a
  378.    known bug that causes the console handler to open up in RAW mode.
  379.    
  380.    The CND: handler uses the deferred opening mode by default.  Deferred
  381.    opening means that the window is not actually opened until it is read
  382.    from or written to; this provides a cosmetic improvment for programs
  383.    that need a window to report error messages.
  384.  
  385.    The CNN: handler, new to V1.3, operates in a mode that allows invisible
  386.    (non-blocking) type-ahead.  After the line you enter has been read, any
  387.    further input is not displayed until the command shell (or other software)
  388.    again reads from the console.  This gives unimpeded access to whatever 
  389.    software is writing to the console.  
  390.    Example:  NewCLI "CND://640/100/VAX Head!"
  391.    
  392.    The CNX: handler is also new to V1.3, and provides extensibility by
  393.    allowing you to specify any EXEC-level device for the console display.
  394.    The display device name and unit are passed immediately following the
  395.    handler name, as in "CNX:device-name/unit".  For example, you could
  396.    specify the serial device as "CNX:serial.device/0", providing an AUX:
  397.    handler with full line editing and command history.  The display device
  398.    must support the standard ANSI control sequences on read and write.
  399.    Example:  NewCLI CNX:serial.device/0
  400.    
  401.    ConMan is also a pipe-handler responding to the name PIP:NNNN, where
  402.    NNNN is the "capacity" of the pipe.  It must be opened using a private
  403.    packet called ACTION_DOUBLE (value 2000L), and the filehandle you get
  404.    from a call to Open("PIP:",2000) counts for two and so can be cloned
  405.    by your program.  After allocating a filehandle structure (using the
  406.    AmigaDOS memory conventions), just copy the filehandle from Open()
  407.    into the new structure --- and don't forget to Close() both of them!
  408.    My WShell command shell uses the ConMan PIP: device as its pipe handler.
  409.    
  410.    Those of you with AmigaDOS 1.3 (but not yet blessed with WShell) will
  411.    appreciate the sly inclusion of the NEWCON: mountlist entry.
  412.  
  413.    
  414.    Break Signals.
  415.    Break signals are generated by typing a control-C, D, E, or F and can be
  416.    delivered to any task that has opened, read from, or written to ConMan.
  417.    The break-signal handling in ConMan is much more sophisticated than that
  418.    in the standard CON: handler, and additional improvements have been made
  419.    in V1.3 to eliminate the possibility of signalling a non-existent task.
  420.    ConMan is able to signal a task that has only read from or written to the
  421.    console -- even if it hasn't opened it -- by holding the break event until
  422.    a read or write request arrives.
  423.    
  424.    In addition to the break signals generated by user input, ConMan will
  425.    send a control-C break to any task that continues to write to the handler
  426.    when it's trying to close.  ConMan is in such a "closing" state after the
  427.    close gadget on a window has been hit, or if it is a PIP: pipe with only
  428.    one open remaining.  This automatic "break-on-write" provides a way of
  429.    propagating a signal back through a series of piped programs.
  430.  
  431.    
  432.    Keymapping.
  433.    ConMan supports the Amiga's keymapping facility, which allows you to 
  434.    reassign the editing functions to the keys of your choice.  To do this, 
  435.    you must first construct a keymap either in assembly language or with
  436.    the help of a keymap editor.  You can then load the keymap using the 
  437.    SetMap program on your Workbench disk.  By default SetMap makes a keymap 
  438.    global; if you want to use a special keymap from just one CLI, you can 
  439.    use the included KeyMap command to define the desired map.  KeyMap with 
  440.    no arguments will display a list of the available keymaps.
  441.    
  442.    
  443.                               ----- Bugs -----
  444.    All known bugs have been fixed in this release, so you should find it to 
  445.    be very reliable.  If you do find a problem, PLEASE report it so I can 
  446.    fix it!!
  447.    
  448.                         ----- Acknowledgements -----
  449.    Special thanks to John Toebes and the Software Distillery for lots of
  450.    great suggestions, to Jeff White for the handsome icons, and to the many
  451.    contributors who made ongoing development and improvements possible.
  452.    
  453.                               -- Bill Hawes (October 5, 1989)
  454.